/**
 * Created by xuehuan on 2016/4/9.
 */
import React from 'react';
class OrgListItem extends React.Component{
    constructor(){
        super();
        this.handleClick = this.handleClick.bind(this);
    }
    handleClick(e) {
        console.log(e.target);
    }
    render(){
        return (
            <div className='orgEach' data-id={this.props.key} onClick={this.handleClick}>
                <img src= {`http://121.42.195.176/EServise/Public/${this.props.data.logo}`} alt="team's logo" />
                <div>
                    组织名：
                    <span className='orgName'>{this.props.data.tm_name}</span>
                </div>
                <div>
                    评价数：<span className='orgEvaluateNum'>{this.props.data.assess}</span>
                </div>
                <div className='introduce'>
                    服务介绍：<span classNmae='orgBrief'>{this.props.data.tm_info}</span>
                </div>
            </div>
        )
    }
};

class OrgList extends React.Component{
    constructor() {
        super();
        this.items = [];
    };
    addItem() {
        var _this = this;
        _this.props.data.team.map(function(item){
            _this.items.push(<OrgListItem data={item} key={item.team_id} />)
        })
    };
    render(){
        this.addItem();
        return (
            <div className="orgList">
                {this.items}
            </div>
        )
    }
}
export default OrgList;
